package com.nulldev.util.web.flexibleKit.scfk.testing;

import java.security.Security;

import com.nulldev.util.JVM.Arguments;
import com.nulldev.util.JVM.JVM;
import com.nulldev.util.networking.misc.TLSUtil;
import com.nulldev.util.web.flexibleKit.scfk.SCFKRequest;
import com.nulldev.util.web.flexibleKit.scfk.SCFKResponse;
import com.nulldev.util.web.flexibleKit.scfk.io.streams.Stream;
import com.nulldev.util.web.flexibleKit.scfk.io.streams.StreamGenerator;
import com.nulldev.util.web.flexibleKit.scfk.protocols.http1.Http1Request;
import com.nulldev.util.web.flexibleKit.scfk.utils.ChannelTOSType;
import com.nulldev.util.web.flexibleKit.scfk.utils.TLSCipherPolicy;

public class SimpleHTTPTest {

	public static void main(String[] args) throws Exception {
		Arguments.setup(args);
		Security.setProperty("jdk.tls.disabledAlgorithms", "");
		Security.setProperty("jdk.tls.legacyAlgorithm", "");
		JVM.println("TLS Implemnentation: " + TLSUtil.getTLSImplementation());
		final SCFKRequest r = new SCFKRequest("https://www.howsmyssl.com/a/check");
		r.setTOSPolicy(ChannelTOSType.TOS_THROUGHPUT);
		final Stream s = StreamGenerator.autoStream(r, TLSCipherPolicy.ENABLE_NULLUTIL_CIPHERS);
		final SCFKResponse sf = new Http1Request().onRequestWrite(r, s);
		JVM.println(sf.asString());
	}

}
